package com.caojing.haolemai.httputils;

import com.caojing.haolemai.bean.ContentBean;
import com.caojing.haolemai.bean.HomeLvBean;
import com.caojing.haolemai.bean.HomeVpBean;
import com.caojing.haolemai.bean.OutletsSharefragmentBean;
import com.caojing.haolemai.bean.ProductBean;
import com.caojing.haolemai.bean.SearchHintBean;
import com.caojing.haolemai.bean.categorybean.CategoryBean;
import com.caojing.haolemai.bean.categoryclickbean.CategoryClickBean;
import com.caojing.haolemai.bean.outletsdetailsbean.OutletsDeatailsBean;
import com.caojing.haolemai.bean.outletsproductbean.OutletsProductBean;
import com.caojing.haolemai.bean.tabBean;
import com.caojing.haolemai.config.UrlConfig;

import java.util.HashMap;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;

/**
 * Created by CaoJing on 2016/10/3.
 */
public interface IHomeService {

    @GET(UrlConfig.Path.HOME_VP_URL)
    Call<HomeVpBean> getHomeVpBean();

    @GET(UrlConfig.Path.HOME_LV_URL)
    Call<HomeLvBean> getHomeLvBean();

    @GET(UrlConfig.Path.SERACH_HINT_URL)
    Call<SearchHintBean> getSearchHintBean();

    //这是分类获取path的方法
    @GET(UrlConfig.Path.CATEGORY_BODY_PATH)
    Call<CategoryBean> getCategoryBean();

    //这是分类点击进入详情的方法
    @GET(UrlConfig.Path.CATEGORYCLICK_PATH)
    Call<CategoryClickBean> getCategoryClickBean(@QueryMap HashMap<String, String> map);

    //    限时特卖的接口
    @POST(UrlConfig.OutletsPath.TAB_PATH_URL)
    Call<tabBean> getTabBean(@QueryMap() Map<String, String> params);

    //    限时特卖中每个fragment的接口
    @FormUrlEncoded
    @POST("app/v14/outlets/list/3/10/{path}")
    Call<OutletsSharefragmentBean> getFragmentInnerBean(@Path("path") String pager, @FieldMap() Map<String, String> params);

    @POST(UrlConfig.OutletsPath.BASE_URL)
    Call<OutletsSharefragmentBean> getFragmentInnerBean(@QueryMap() Map<String, String> params);

    @GET(UrlConfig.Path.CONTENT_URL)
    Call<ContentBean> getContentBean(@Path("path") String path, @QueryMap() HashMap<String, String> params);

    //    得到限时特卖的详情页面的接口
    @GET("app/v14/outlets/coms/{path1}/10/{path2}")
    Call<OutletsDeatailsBean> getDetailsBean(@Path("path1")String id, @Path("path2")String pager, @QueryMap()Map<String,String>params);
//    Call<OutletsDeatailsBean>getDetailsBean(@Part("path1")String id,@Part("path2")String pager,@QueryMap()Map<String,String>params);
//    @FormUrlEncoded
//    @POST("app/v14/outlets/coms/{path1}/10/{path2}")
//    Call<OutletsDeatailsBean> getDetailsBean(@Path("path1")String id,@Path("path2")String pager,@FieldMap()Map<String,String>params);


      // 得到限时特卖的购物车页面的接口
      //    http://platform.okbuy.com/app/v14/product/get_detail_infos/17438624?if_add_self_to_relate_coms=1
    @GET("app/v14/product/get_detail_infos/{path}")
     Call<OutletsProductBean>getIproductBean(@Path("path")String productId, @QueryMap()Map<String,String>params);

    @GET(UrlConfig.Path.PRODUCT_DETAIL)
    Call<ProductBean> getProductBean(@Path("path")String path);

}
